﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Product Product { get; set; }
        public Form1()
        {
            InitializeComponent();
        }

        private void OKBtn_Click(object sender, EventArgs e)
        {
           
            Product.barCode = textBox1.Text;
            Product.name = textBox2.Text;
          
          //  MessageBox.Show("sleep");
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            if (Product != null)
            {
                textBox1.Text = Product.barCode;
                textBox2.Text = Product.name;
            }
            else
            {
                Product = new Product();
            }

        }

        private void button1_Click(object sender, EventArgs e)
        {
            Product.barCode = textBox1.Text;
            Product.name = textBox2.Text;

            //  MessageBox.Show("sleep");
        }
    }
}
